<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>后端菜单</title>
	<script>document.write('<script src="../../plugin/vue/js/import.js?' + Math.random() + '"><' + '/script>');</script>

<script>
	_import("../../plugin/vue/js/before.js");
</script>
<style>
[v-cloak] {
	display:none !important;
}
</style>
</head>
<body>
	<div class="w-h100" id="app" v-cloak>
	 	 <div class="left_side" v-if="show_bar">
	           <div class="panel panel-default">
					<div class="panel-heading" id="panel-heading-div">
						<h3 class="panel-title">
							<i class="icon-user"></i>菜单结构
						</h3>
					</div>
					<div class="panel-body w-jheight">
						<!--  
						<el-input
						  placeholder="输入关键字进行过滤"
						  v-model="filterText">
						</el-input>
						-->
						<el-tree ref="tree" class="filter-tree w-filter-tree"  
				 			node-key="id" :data="treelist" :props="defaultProps"  :filter-node-method="filterNode"
				 			@node-click="handleNodeClick" :default-expanded-keys="[curTreeId]"></el-tree>
					</div>
			  </div>
	    </div>
	    <div class="toggle">
			<div class="bar-con-l" @click="toggle_bar">
				<div class="bar"></div>
			</div>
		</div>
		
		<div class="right_side">
		  <div class="panel panel-default">
		  		<div class="panel-heading" id="panel-heading-div">
			  		<h3 class="panel-title">
						<i class="icon-user"></i>菜单管理
					</h3>
				</div>
  				<div  class="w-tr" style=" margin-top: 10px; margin-right: 30px;">
					<el-button type="primary"  v-if="editable" @click="mdfMenu('edit')">编辑</el-button>
					<el-button type="primary"  v-if="addable" @click="mdfMenu('add')">添加</el-button>
					<el-button type="primary"  v-if="delable" @click="mdfMenu('del')">删除</el-button>
				</div>
				<div class="panel-body w-pt5 w-jheight">	
					<el-table :data="menuInfo" border style="width: 100%">
		    			<el-table-column prop="name" label="名称">
		    			</el-table-column>
    					<el-table-column prop="value" label="取值">
    						<template slot-scope="scope">
    							<img v-if="scope.row.name=='LOGO'" id="logo" height="25px" width="25px"  :src="scope.row.value"/>
    							<span v-else>{{scope.row.value}}</span>
    						</template>
		    			</el-table-column>		    
		    		</el-table>
   				
				</div>
				
				
				<el-dialog :title="menuExec" :visible.sync="menuForm" :close-on-click-modal="false" @close="close" top="3%" class="w-dialogpd"  > 
					    <el-form ref="form" :rules="rules" :model="form" label-width="82px" >
					      <el-form-item label="菜单名称">
						    <el-input v-model="form.menu_name"></el-input>
						  </el-form-item>
						  
						  <el-form-item label="父菜单名称">
						    <el-input v-model="form.menu_superior_name" disabled></el-input>
						  </el-form-item>
						  
						  <el-form-item label="是否显示">
						  	 <label class="radio-inline"> 
						 	 	<input type="radio" v-model="form.is_display" value="Y" name="display">是
    			  			 </label>
   				  			 <label class="radio-inline">
      						  <input type="radio" v-model="form.is_display" value="N" name="display">否
      						 </label>
						  </el-form-item>
						
						  <el-form-item label="链接">
						    <el-input v-model="form.menu_href"></el-input>
						  </el-form-item>
						  
						  <el-form-item label="显示顺序" prop="display_order">
						    <el-input v-model.number="form.display_order"></el-input>
						  </el-form-item>
						  
						  <el-form-item label="所属权限" > 
						     <el-select v-model="right" @change="getPrivs" >
							    <el-option v-for="item in rights" :key="item.priv_group"
							      :label="item.priv_group" :value="item.priv_group" >
							    </el-option>
							 </el-select>
							 <el-select v-model="form.menu_rights" collapse-tags  placeholder="请选择" class="ml5">
							    <el-option v-for="item in privs" :key="item.priv_name" 
							    	:label="item.remarks" :value="item.priv_name">
							    </el-option>
						  	  </el-select>
						  </el-form-item>
						  
						  <el-form-item label="目标">
						    <el-input v-model="form.target"></el-input>
						  </el-form-item>
						  
						  <el-form-item label="样式">
						    <el-input v-model="form.iconclass"></el-input>
						  </el-form-item>
						  <el-form-item label="LOGO">
						 	<div id="upLogo" style="display:none;"></div>	
						    <img id="logo" width="80px" height="80px" title="修改logo" :src="form.menu_logo" @Click="upload()"/>					    
						  </el-form-item>		
						  		  
						</el-form>
				 		
					  <div slot="footer" class="dialog-footer tr mt-20">
					    <el-button @click="cancel">取 消</el-button>
					    <el-button type="primary" @click="save">保存</el-button>
					  </div>  
				</el-dialog>
				  
				
		  </div>
		</div>
		
	</div>
	
	
	<script>
		_import("../../plugin/webuploader/webuploader.js");
		_import("../../plugin/vue/js/after.js");		
		//_import("../../plugin/js/user.js");
	</script>
	<script>
		_import("js/menu.js");
		var wHight = $(window).height()-90;
		var bHight = wHight + "px";
		$(".w-jheight").css("height",bHight);
	</script>
</body>
</html>